﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;

namespace MeiRiCai.Sdk.Core
{
	public class OauthUtils
	{
		public static String GetHttpBodyText(Uri uri)
		{
			HttpWebRequest request = WebRequest.CreateHttp(uri);
			IAsyncResult asyncResult = request.BeginGetResponse(pResult => { }, null);
			using (HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult))
			{
				Stream stream = response.GetResponseStream();
				StreamReader reader = new StreamReader(stream);
				return reader.ReadToEnd();
			}
		}
	}
}
